<?php
/**
 * Created by PhpStorm.
 * User: logan
 * Date: 11/19/14
 * Time: 8:05 PM
 */

namespace EasyVote\EasyVoteBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use \DateTime;

/**
 * This class represents a reminder to vote in an election.
 *
 * @ORM\Entity()
 */
class ElectionReminder {

    /**
     * The id of the reminder
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * The election
     * @var Election
     * @ORM\ManyToOne(targetEntity="Election")
     */
    private $election;

    /**
     * The time to send the reminders
     * @var DateTime
     * @ORM\Column(name="reminderTime", type="datetime")
     */
    private $reminderTime;

    /**
     * Gets the id
     * @return int
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Gets the election
     * @return Election
     */
    public function getElection()
    {
        return $this->election;
    }

    /**
     * Sets the election
     * @param Election $election
     */
    public function setElection($election)
    {
        $this->election = $election;
    }

    /**
     * Gets the reminder time
     * @return DateTime
     */
    public function getReminderTime()
    {
        return $this->reminderTime;
    }

    /**
     * Sets the reminder time
     * @param DateTime $reminderTime
     */
    public function setReminderTime($reminderTime)
    {
        $this->reminderTime = $reminderTime;
    }

    /**
     * Gets the reminder time as a string.
     * @return string
     */
    public function getReminderTimeAsString(){
        return $this->getReminderTime()->format('Y-m-d H:i:s');
    }
} 